home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 432_01 / ptmid3 / ptmid.doc < prev    next >
Text File  |  1994-07-17  |  17KB  |  351 lines

  1. NAME
  2.  
  3.      ptmid - Creates Protracker MOD files or Multitracker MTM files 
  4.              from General MIDI files (ver 0.3)
  5.  
  6.  
  7. SYNOPSIS
  8.  
  9.      ptmid [-cFile] [-dChannel] [-fFrac] [-q] [-s] infile[.mid]
  10.           [outfile[.mod]]
  11.  
  12.  
  13. DESCRIPTION
  14.  
  15.      Ptmid will take either standard MIDI format 0 or format 1 files and
  16.      convert them into various Tracker-type files. MIDI files are
  17.      industry standard, but need some sort of sequencer to be played, as
  18.      there can be near infinite simultaneous notes (though about 20 is a
  19.      standard maximum). Protracker files are 4 channel (though 6, 8, and
  20.      just about any other variety is supported) files, but have a bank
  21.      of digitized instruments included, so reasonable quality sound is
  22.      produced given limited hardware. Multitracker files are similar,
  23.      and support upto 32 simultaneous notes. Both Protracker and
  24.      Multitracker files are referred to as Tracker files in this
  25.      document.
  26.  
  27.      The differences between MIDI (extension .mid) and Tracker
  28.      (extension .mod or .mtm) formats are more than superficial, and a
  29.      fair bit of information is needed to be able perform the conversion
  30.      - most of this is held in the configuration file: ptmid.cfg
  31.  
  32.      The format of ptmid.cfg is fairly simple: Any line beginning with a
  33.      hash (#) is ignored, other lines contain configuration info. The
  34.      first word on a line (called a tag) specifies what sort of
  35.      information (and sometimes only one word is needed), anything
  36.      following this word is used as supplementary information and
  37.      depends of the sort of option specified by the first word. 
  38.  
  39.      One type of word needs a little explaining: pitch. A pitch, when
  40.      used in the configuration file, is a character string in the format
  41.      of: C2, C#2, D2, D#2, E2, F2, F#2, G2, G#2, A2, A#2, B2 (that was a
  42.      whole octave beginning with middle C). Other octaves can be used in
  43.      place of 2, eg. D#2, A-1, etc.
  44.  
  45.      Here are a list of the tags permissible in the configuration file:
  46.  
  47.           spath: The word following this tag is the name of the
  48.           directory that any subsequent samples will be found in. It
  49.           must end in a trailing slash, and be located in the file
  50.           before any line using the tags: def, xx, or dxx.
  51.  
  52.           def, or xx (where xx is a number): These options supply
  53.           information on what samples (digitized instruments) should be
  54.           allocated to what MIDI instrument numbers. "def" is the
  55.           default non-percussion instrument, and must always be
  56.           specified. "xx" is a specific MIDI instrument. After the tag
  57.           are the filenames of the samples that can be used to represent
  58.           the instrument (if multiple filenames are used, then the one
  59.           sampled closest to the desired pitch for a note is chosen from
  60.           the list). If an allocation is not present for some particular
  61.           instrument, then the default instrument is used instead. A
  62.           shortcut is to put a quotes (") mark instead of a list of
  63.           filenames. This tells Ptmid that that instrument is identical
  64.           to the last one specified.
  65.  
  66.           dxx (where xx is a number): This is similar to the above tag,
  67.           but applies to percussion samples. The first word following
  68.           the tag is the filename of the sample to associate with the
  69.           appropriate MIDI percussion instrument (only one filename can
  70.           be used). If there is another word following this, it is the
  71.           pitch to play the sample at when used in the Tracker file.
  72.           There is no default sample for non-specified percussion
  73.           instruments, as these are simply not played.
  74.  
  75.           sample: The information following this tag tells Ptmid crucial
  76.           information about a sample. Samples can either be in .SMP
  77.           format (this is the default, and corresponds to headerless, 8
  78.           bit signed data), .WAV format, or .VOC format. The first word
  79.           following the tag is the filename of the sample which is to be
  80.           defined (and must correspond exactly to the filename of this
  81.           sample used elsewhere in the ptmid.cfg file). The next word is
  82.           the pitch of the sample when it's played (at 8287 Hz for .SMP
  83.           files, or the normal rate for .WAV or .VOC files). Optionally,
  84.           it can then be followed by a loop-start offset and a loop-
  85.           length (in that order), specified in words (1 word = 2 bytes).
  86.           After a sample is played it will stop if no loop information
  87.           is given, otherwise it will start looping at the loop-start
  88.           address and continue for the length of the loop-length
  89.           (looping continues indefinitely). A "sample" must be present
  90.           for EVERY filename given in one of the above options (def, xx,
  91.           or dxx).
  92.  
  93.           drumch: The percussion channel is assumed to be 10, but some
  94.           MIDI devices assume it is elsewhere, and so Ptmid must know
  95.           what channel it will be to perform a correct conversion.
  96.           Following the tag name is a number which is the percussion
  97.           channel. Common values are 10 and 16.
  98.  
  99.           fract: Ptmid quantizes (that is, groups notes to the closest
  100.           note) MIDI files duration conversion, and so must know what
  101.           the smallest type of note is. Following the tag name is a
  102.           number (possibly with a suffix of "t") which represents a type
  103.           of note - this is the quantize fraction. Valid fractions are
  104.           of the form: 4, 4t, 8, 8t, 16, 16t, etc. where 4 means a
  105.           quarter note (crotchet), 4t means a triplet, 8 means an
  106.           eighth-note (quaver), 8t means quaver-triplets, etc. It
  107.           usually can't hurt to give a smaller note (larger value),
  108.           though it uses up more memory, but the critical part is
  109.           knowing if a triplet note is needed. If not specified, the
  110.           fraction is assumed to be 16. This option can be overridden
  111.           with the similar option specified on the command line.
  112.  
  113.           modfmt: This tag chooses the type of Tracker file to produce.
  114.           If the word following the tag name is "1", then Protracker
  115.           .mod files are produced (this is the default). If the word is
  116.           "2", then Multitracker .mtm files are produced.
  117.  
  118.           maxchan: Following this tag is a number representing the
  119.           number of channels to have in the final Tracker file. It will
  120.           default to 4, and can have values upto 32. If creating a
  121.           Protracker file, putting values other than 4 may result in a
  122.           .mod file that cannot be played by your Tracker program,
  123.           although 6 and 8 are common too.
  124.  
  125.           extend: If this tag is present, then an extended range of
  126.           notes is allowed during conversion. Usually there is a 3
  127.           octave range, but since MIDI allows a 9 octave range
  128.           converted files can sound wrong. With an extended range, 5
  129.           octaves are supported, but you need special trackers for this
  130.           (the tracker DMP is one example). The best solution for this
  131.           problem is to use multiple samples, each of which is digitized
  132.           an octave apart, and specify all of them for an instrument.
  133.  
  134.           rgmode: There are 3 things Ptmid can do if despite using
  135.           "extend", a note is out-of-range. These things can be chosen
  136.           by specifying a number following this tag:
  137.                0 - This rounds a note to the nearest pitch (the default)
  138.                1 - Drop the note altogether
  139.                2 - Transpose the note by octaves until it's in range
  140.           Mode number 2 sounds the best, but it can generate melodies
  141.           that don't sound like the original, and is not the default.
  142.  
  143.           nocopy: This tag will stop copyrighted MIDI files being
  144.           converted if it is present. Since MIDI files support a
  145.           copyright notice as part of their official format, I thought
  146.           that this wo